package cn.weiyang.spring.springmvc.controller;

import cn.weiyang.spring.mybatis.model.UserPage;
import cn.weiyang.spring.mybatis.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 用户控制层
 * Created by Administrator on 2017/7/25.
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private IUserService userService;

    /**
     * 模糊查询用户列表
     * @param pageSize
     * @param pageNum
     * @param name
     * @return
     */
    @RequestMapping("/list")
    public UserPage getLikeUsers(Integer pageSize,Integer pageNum,String name){
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("pageSize",pageSize);
        map.put("pageNum",pageNum);
        map.put("name",name);
        UserPage userPage=userService.getLikeUsers(map);
        return userPage;
    }

}
